﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ITAP.ContourBuilder.Components.Dimensions;

namespace ITAP.ContourBuilder.Components.Constraints
{
    [Serializable]
    public class ConstraintRecalculateDimension : Constraint
    {
        public override bool Check(IContourComponent component)
        {
            return false;
        }

        public override void Fix(IContourComponent component)
        {
            if (!enabled)
                return;

            if (!(component is Dimension))
                return;

            Dimension dimension = component as Dimension;
            dimension.Recalculate();
        }
    }
}
